﻿<script type="text/javascript" >
		function check_act() {
		var msg = "您确定要?\n请确认！";
		if (confirm(msg)==true){
			//document.location.href='../main.aspx';
			return true;
			}else{
			return false;
			}
		}	
</script>

<?php
require './dag_functions/class_core_utf-8.php';
$file_dep=$_GET["file_dep"];
$file_id=$_GET["file_id"];
$usertype=$_GET["usertype"];
$userdep=$_GET["userdep"];


if($usertype=="单位保密员")
{
	$result = DB::query("SELECT * FROM tab_jyqq WHERE jyqq_file_id='".$file_id."' and jyqq_dep ='".$userdep."'");
}
else if($usertype=="档案管理员")
{
	$result = DB::query("SELECT * FROM tab_jyqq WHERE jyqq_file_id='".$file_id."' and jyqq_status =1 OR jyqq_status =3 OR jyqq_status =4");	
}
//$result = DB::query("SELECT * FROM tab_jyqq WHERE jyqq_file_id='".$file_id."'");
				echo "<table style='font-size:12px'  border='1'>
				<tr>
				<th width='80'>借阅人ID</th>
				<th width='90'>借阅人单位</th>
				<th width='250'>借阅说明</th>
				<th width='70'>借阅时间</th>
				<th width='70'>截止时间</th>
				<th width='70'>状态</th>
				<th>操作</th>
				
				</tr>";
				
				while($row = DB::fetch($result))
				 {
				 
				 echo "<tr>";
				 echo "<td>" . $row['jyqq_user_id'] . "</td>";
				 echo "<td>" . $row['jyqq_dep'] . "</td>";
				 echo "<td>" . $row['jyqq_reason'] . "</td>";
				 echo "<td>" . $row['jyqq_time'] . "</td>";
				 echo "<td>" . $row['jyqq_time_end'] . "</td>";
				 echo "<td>" . $row['jyqq_status']. $JYQQ_STATUS[$row['jyqq_status']] . "</td>";
				 
				 //echo "<td>" . "<input type=\"button\" onClick=\"javascript:{document.location.href='file_jyqq_s1.php?jyqq_id=".$row['jyqq_id']."&act=yes';}\" value=\"同意\"><input type=\"button\" onClick=\"javascript:document.location.href='file_jyqq_s1.php?jyqq_id=".$row['jyqq_id']."&act=no';\" value=\"拒绝\">" . "</td>";
				 if ($usertype=="单位保密员")
					{
						if(($row['jyqq_status']=="0")||($row['jyqq_status']=="1")||($row['jyqq_status']=="2"))
						{
							echo "<td>" . "<input type=\"button\" onClick=\"javascript:{document.location.href='file_jyqq_s1.php?jyqq_id=".$row['jyqq_id']."&step=1&level=1&act=yes';}\" value=\"同意\"><input type=\"button\" onClick=\"javascript:document.location.href='file_jyqq_s1.php?jyqq_id=".$row['jyqq_id']."&step=1&level=1&act=no';\" value=\"拒绝\">" . "</td>";
						}
						else
						{echo "<td> </td>";}
					}
					else if ($usertype=="档案管理员")
					{
						if (($row['jyqq_status']=="1")||($row['jyqq_status']=="3")||($row['jyqq_status']=="4"))
						{
							echo "<td>" . "<input type=\"button\" onClick=\"javascript:{document.location.href='file_jyqq_s1.php?jyqq_id=".$row['jyqq_id']."&step=2&level=2&act=yes';}\" value=\"同意\"><input type=\"button\" onClick=\"javascript:document.location.href='file_jyqq_s1.php?jyqq_id=".$row['jyqq_id']."&step=2&level=2&act=no';\" value=\"拒绝\">" . "</td>";
						}
						else
						{echo "<td> </td>";}
					}	
					
					
				 echo "</tr>";
				 }
				echo "</table><br/>";

?>